#include <stdio.h>

#define MAXN 10

// https://pintia.cn/problem-sets/14/exam/problems/734?type=6&page=0

double f( int n, double a[], double x );

int main(void)
{
	int n, i;
	double a[MAXN], x;
	
	scanf("%d %lf", &n, &x);
	for ( i=0; i<=n; i++ ){
		scanf("%lf", &a[i]);
	}
	printf("%.1f\n", f(n, a, x));
	return 0;
}

/* 你的代码将被嵌在这里 */
double f( int n, double a[], double x ){
	
	double sum;
	
	for(int i=0;i<=n;i++){
		if(i==0){
			sum += a[0] * 1;
		} else if (i==1){
			//TODO
			sum += a[1] * x;
		} else {
			double xi = 1;
			for(int j=1;j<=i;j++){
				xi *=x;
			}
			sum += a[i] * xi;
		}
	}
	
	return sum;
}
